import {observable,action,computed} from 'mobx'
import { ajax } from '../api';

class Classes{
    @observable classList:any=null;

    @action getClassList=async()=>{
        let res=await ajax.classlist()
        res.code=200&&(this.classList=res.result)
        
    }
    @action changeclass= (payload:any) =>{
        this.classList = payload;
    }

//查询未分配老师1的课程，2为分配的老老师
    @observable classList1:any=null;
    @observable classList2:any=null;
    @action getClassList1=async()=>{
        let res=await ajax.classlist()
        if(res.code==200){  
                this.classList1=res.result.filter((v:any)=>!v.classTeacher)
                this.classList2=res.result.filter((v:any)=>v.classTeacher)
        }
    }
}

export default new Classes() 